//
// Created by DELL on 2025/2/5.
//

#include "Thread.h"

#include <thread>
#include <utility>

namespace zdotp {
    Thread::Thread(ThreadHandler handler)
    : handler_(std::move(handler)),
    thread_id_(++generate_id){}

    Thread::~Thread() {
    }

    void Thread::start() {
        std::thread t(handler_, thread_id_);
        t.detach();
    }

    int Thread::get_thread_id() const {
        return thread_id_;
    }
} // zdotp